﻿{include file="public/header" /}
<body>
  <div class="x-nav">
    <span class="layui-breadcrumb">
      <a href="">首页</a>
      <a href="">任务管理</a>
      <a href="">在制任务</a>
      <a>
        <cite>检验记录</cite>
      </a>
    </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
      <i class="layui-icon" style="line-height:30px">ဂ</i></a>
  </div>
  <div class="x-body">
    <xblock>
      <button class="layui-btn" onclick="x_admin_show('添加{$id}的检验记录','{:url(\'index/TestRecord/addShow\',[\'id\'=>$id])}',500)"><i class="layui-icon"></i>添加检验记录</button>
      <span class="x-right" style="line-height:40px">共{$testRecordCount}条</span>
    </xblock>
    <div class="layui-row">
      <div class="container-wrap">
        <div class="box-1">
          <table class="layui-table">
            <thead>
              <tr>
                <th>操作</th>
                <th>序号</th>
                <th>名义尺寸</th>
                <th>员工实测</th>
                <th>检验实测</th>
                <th>备注</th>
              </tr>
            </thead>
            <tbody>
            {volist name="testRecord" id="list"}
              <tr>
                <td width="40">
                  <a title="编辑"onclick="x_admin_show('修改操作','{:url(\'index/TestRecord/editShow\',[\'id\'=>$list.id])}',500)" href="javascript:;">
                    <i style="color: green" class="layui-icon"></i>
                  </a>
                  <a title="删除" onclick="delete_(this,'{$list.id}')" href="javascript:;">
                    <i  style="color:red;" class="layui-icon"></i>
                  </a>
                </td>
                <td width="40">{:substr($list['check_id'],-2)}</td>
                <td>{$list.nromal_dim}</td>
                <td>{$list.real_dim1}</td>
                <td>{$list.real_dim2}</td>
                <td>{$list.remark}</td>
              </tr>
            {/volist}
            </tbody>
          </table>
        </div>
      </div>
    </div>
  </div>
<script>
    /*删除*/
    function delete_(obj,id){
        layer.confirm('确认要删除吗？',function(index){
            var url = "{:url('index/TestRecord/delete')}";
            var postData ={"id":id};
            $.post(url,postData,function (result) {
                if(result === 1 ){
                    $(obj).parents("tr").remove();
                    layer.msg('已删除!',{icon:1,time:1000});
                }else {
                    layer.alert("删除失败", {icon: 5});
                }
            },"json");
        });
    }
</script>
</body>
</html>